Security News
JavaScript Leaders Demand Oracle Release the JavaScript Trademark
In an open letter, JavaScript community leaders urge Oracle to give up the JavaScript trademark, arguing that it has been effectively abandoned through nonuse.
nuke-refresh-control
Advanced tools
RefreshControl 是一个能够实现下拉刷新的子组件,且父组件只能是 <Scrollview>
或 <ListView>
。
// 完整 demo 请参考 ScrollView 组件的 Demo
//初始 state
constructor() {
super();
this.state={
isRefreshing: false,
refreshText: '↓ 下拉刷新',
data:[
//...省略部分代码
]
}
}
handleRefresh =()=>{
this.setState({
isRefreshing: true,
refreshText: '加载中',
});
// mock ajax 此处替换为你的 ajax 请求
setTimeout(() => {
this.setState({
isRefreshing: false,
data: [
// data 字段变更
],
refreshText: '↓ 下拉刷新',
});
}, 1000);
}
render(){
return(
<ScrollView>
<RefreshControl isRefreshing={this.state.isRefreshing} style={{width:750,height:100}} onRefresh={this.handleRefresh}>
<Text>{this.state.refreshText}</Text>
</RefreshControl>
{/* 此处为你的内容区域 */}
<ScrollView>
)
}
参数 | 说明 | 类型 | 默认值 |
---|---|---|---|
isRefreshing | 是否展示 | false | |
onRefresh | refresh 事件 | Function | |
style | 样式,必须声明宽高否则可能无法展示 | object |
FAQs
The npm package nuke-refresh-control receives a total of 12 weekly downloads. As such, nuke-refresh-control popularity was classified as not popular.
We found that nuke-refresh-control demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
In an open letter, JavaScript community leaders urge Oracle to give up the JavaScript trademark, arguing that it has been effectively abandoned through nonuse.
Security News
The initial version of the Socket Python SDK is now on PyPI, enabling developers to more easily interact with the Socket REST API in Python projects.
Security News
Floating dependency ranges in npm can introduce instability and security risks into your project by allowing unverified or incompatible versions to be installed automatically, leading to unpredictable behavior and potential conflicts.